<script>
	export default {
		globalData:{
			fontSize:uni.getStorageSync('fontSize') || '10px'
		},
		onLaunch: function() {
			console.log('App Launch')
			
			var script = document.createElement('script');
			script.src ="https://www.test.weichengbx.com/record/index.js";//外部链接js包
			document.body.appendChild(script);
			
			
			// let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab","headIconClick"];
			let list = [""];
			list.forEach(item => {
				uni.addInterceptor(item,{
					
					invoke(e) {
						console.log('拦截前的操作',e);
						//获取用户缓存数据
						const userInfo = uni.getStorageSync('userInfo'),
						//获取用户授权状态
						   isAuthorize = uni.getStorageSync('isAuthorize');
						if(!isAuthorize){
							// #ifdef APP
							uni.showModal({
								title: '温馨提示',
								content: '登录后使用功能，是否前往登录？',
								success(res) {
									if (res.confirm) {
										uni.navigateTo({
											url: 'pages/Login/Login'
										});
									}
								}
							})
							// #endif
							// #ifdef MP-WEIXIN
							uni.$emit('getAuthorize', {
							    data: '授权'
							});
							// #endif
							return false;
						}
					},success(args) {
						console.log(args);
					},fail(err) {
						console.log('interceptor-fail',err)
					},complete(res) {
						console.log('interceptor-complete',res)
					}
				})
			})
			
		},
		
		onShow: function() {
			wx.showShareMenu({
			    withShareTicket:true,
			    //设置下方的Menus菜单，才能够让发送给朋友与分享到朋友圈两个按钮可以点击
			    menus:["shareAppMessage","shareTimeline"]
			})
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide') 
		},
		
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "uview-ui/index.scss";
	@import  "common/css/common.css";
	@import "common/css/jh_common.css"; 
	page{
		background-color: #F5F9FC; 
		// filter: grayscale(100%);
	}
	.scroll-view{
		width: 100%;
		// 规定段落中的文本不进行换行
		white-space: nowrap;
		position: relative;
		display: flex;
	}
</style>
